<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<style type="text/css">
		.red{
			background: red url() 0 0 no-repeat;
		}
		.blue{
			background: blue url() 0 0 no-repeat;
		}
	</style>
	<script type="text/javascript">
	document.write("<table border='1'>");
	for (var i = 1; i <= 9; i++) {
		document.write("<tr>");
		for (var y = 1; y <= i; y++) {
			if((y%2)==1){
				document.write("<td class='red'>");
			}else{

				if((i%2)==0){
					document.write("<td class='blue'>");
				}else{
					document.write("<td>");
				}
				
			}
			document.write(i+"*"+y+"="+(i*y));
			document.write("</td>");
		};
		document.write("</tr>");
	};
	document.write("</table>");



	function sum (num1 , num2) {
		name = 'xbs';
		return num1+num2;
	}

	// var res = sum(23,56);

	// alert(res);

	function digui (num) {
		if(num==1){
			return 1;
		}
		return num+digui(num-1);
	}

	// function digui (3) {
	// 	if(3==1){
	// 		return 1;
	// 	}
	// 	return 3+digui(2);
	// }

	// function digui (2) {
	// 	if(2==1){
	// 		return 1;
	// 	}
	// 	return 2+digui(1);
	// }

	// function digui (1) {
	// 	if(1==1){
	// 		return 1;
	// 	}
	// 	return 1+digui(1-1);
	// }

	// var res = digui(3);
	// alert(res);


	var arr = [1,56,23,6,43,87,3,5,55];

	function maxNum (arr1) {
		temp = arr1[0];
		for (var i in arr1) {
			if(temp<arr1[i]){
				temp=arr1[i];
			}
		};
		return temp;
	}

	var res = maxNum(arr);

	// alert(res);

	var arr = new Array(6);
	arr[0] = "George";
	arr[1] = "John";
	arr[2] = "Thomas";
	arr[3] = "James";
	arr[4] = "Adrew";
	arr[5] = "Martin";

	document.write(arr + "<br />")
	arr.splice(2,1,"William")
	document.write(arr)

	</script>
</head>
<body>
	
</body>
</html>